package spring.hibernate.jaiku.dao.imp;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateTemplate;

import spring.hibernate.jaiku.dao.ComentarioDao;
import spring.hibernate.jaiku.modelo.Comentario;

//otra forma de obtener la session factory: ver EntradaHibernate
public class ComentarioHibernate implements ComentarioDao {

	private HibernateTemplate hibernateTemplate = null;

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.hibernateTemplate = new HibernateTemplate(sessionFactory);
	}

	public void nuevoComentario(Comentario comentario) throws Exception {
		
		hibernateTemplate.persist(comentario);
		
	}

}
